import App from '@/views/bnpmList/modify/modify.vue';

import Vue from 'vue';
import ELEMENTUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'reset.css';
import {registerGlobal} from '@/views/registerGlobal.js'
Vue.use(ELEMENTUI, {size: 'small', zIndex: 3000});


import "@/views/assets/styles/index.scss";
import "@/views/assets/styles/ruoyi.scss";

import  jsCookie from 'js-cookie'
import {getUrlParam} from '@/utils/index.js'

function preInit() {
    var authToken = getUrlParam("authToken")
    if (!authToken) {
        return Promise.resolve({success: false,message:"没有 authToken,请联系管理员"})
    }
    jsCookie.set("authToken", authToken)

    return Promise.resolve({success: true})
}

function init() {
    new Vue({
        el: '#app',
        render: h => h(App),
    });
}

(async () => {
    var resultEntity = await preInit();
    if (!(resultEntity && resultEntity.success)) {
        document.documentElement.querySelector("#app").textContent = resultEntity?.message||'初始化失败'
        return resultEntity;
    }
    init()
})()



